import pygame

from Action.Draw_Actors import DrawActors


class Shoot_Bullet(pygame.sprite.Sprite):
    """
       初始化多张图片组成的精灵
        :param x: 精灵坐标x
        :param y: 精灵坐标y
        :param path: 图片地址
        :param num: 图片数量
    """

    def __init__(self, x: int, y: int, path: str, num: int):
        super(Shoot_Bullet, self).__init__()
        self.action = DrawActors(path, num, True)
        self.pos_x = x
        self.pos_y = y
        self.rect = pygame.Rect(self.pos_x + 5, self.pos_y + 5, 10, 10)

    def draw(self, surface):
        """
        精灵绘制
        :param surface: 绘制surface
        :return:
        """
        current_img = self.action.get_image()
        surface.blit(current_img, (self.pos_x, self.pos_y))

    # def shoot(self):
    #     """
    #     精灵运动,主动运动
    #     :return:
    #     """
    #     if self.pos_x < 1050:
    #         self.pos_x += 5
